#pragma once

#ifndef __INPUT_HELPER_H__
#define __INPUT_HELPER_H__

#include "Common.h"
#include "LogManager.h"

typedef struct
{
	POINT clickCoordinates;
	int sensibility;
} InputOptions;

// Helper for input operations.
class InputHelper
{
public:
	int Sensibility;

	// Construct InputHelper.
	InputHelper();

	// Construct InputHelper with given options.
	InputHelper(InputOptions& inputOptions);

	// Set the cursor position.
	void SetCursorPosition();

	// Set the cursor position.
	void GetCursorPosition();

	// Try to get the cursor position.
	bool GetCursorPosition(POINT& coordinates);

	// Do a left click.
	void LeftClick();

	// Check if a pixel color match the sensibility.
	bool CheckPixel(const POINT& coordinates);

private:
	long m_cursorCoordinateX, m_cursorCoordinateY;
	HWND m_hWnd;

	// Convert to absolute coordinates.
	void ConvertToAbsoluteCoordinates(POINT& coordinates);
};

#endif  // __INPUT_HELPER_H__